import { reactive, toRefs } from "vue";

export const useCounters = (initCount:any) => {
// initcount 可以有也可以没有
	const state = reactive({count: initCount})
  const add = function(){
    state.count++
  }
  const minus = function(){
    state.count--
  }
  return {state,add,minus}
};


// export const useCounters = () => {

//   // initcount 
// 	const state = reactive({count: 0})

//   const add = function(){
//     console.log('add')
//     state.count++
//   }

//   const minus = function(){
//     state.count--
//   }

//   return {state,add,minus}

// };
